package entities;

import java.util.Date;

import javax.persistence.Id;

import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.Unindexed;

public class Category {
	@Id 
	private String id;
	
	@Unindexed 
	private String name = "";
	
	@Unindexed
	private String alias = "";
	
	@Unindexed 
	private String desc = "";
	
	@Indexed 
	private String parentId = "";
	
	/*
	 * Parent contain all parent id form parent root to this category.
	 * Example category is Ha noi. Parent root is : Countries (id: 15) --> Vietnam (id: 256) --> Ha noi (Id: 1000)
	 * parent values is : 15,256,1000
	 */
	@Indexed 
	private String parents = "";
	
	/*
	 * Level category, start is 1.
	 */
	@Indexed 
	private int level = 1;
	
	@Unindexed 
	private int count = 0;
	
	@Indexed 
	private int status = 2; //0-Inactive, 1-Pending, 2-Active
	
	@Unindexed 
	private Date created = new Date();
	
	@Indexed 
	private String creator = ""; 

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getParents() {
		return parents;
	}

	public void setParents(String parents) {
		this.parents = parents;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}
	
}
